let oList = document.querySelector('#menu');
let oNoData = document.querySelector('#no-data');
// var  rt = document.getElementsByClassName('rt')[0];
let queryArr = [];
let allFundList = [
    {
    fundname:'发票问题',
      fundcode:"发票中是否显示运费金额？"
  },
  {
    fundname:'微分销',
      fundcode:"如何申请成为分销商？"
     
  },
  {
    fundname:'3G资讯',
      fundcode:"三星电子宣布将在中国发布15款3G手机"
     
  },
  {
    fundname:'站内快讯',
      fundcode:"三星SGHU308说明书下载"
  },
  {
    fundname:'商城公告',
      fundcode:"管理功能说明"
     
  },
  {
    fundname:'商家入驻流程说明',
      fundcode:"了解更多"
  },

  {
    fundname:'网店信息',
      fundcode:"公司简介"
     
  },
  {
    fundname:'配送与支付',
      fundcode:"上门自提"
     
  },
  {
    fundname:'新手上路',
      fundcode:"售后流程"
     
  },
  {
    fundname:'3G资讯',
      fundcode:"诺基亚牵手移动 5款热门TD手机机型推荐",
      
  }];
let li;

function onInput(val){
// console.log(val)

// if(oList.innerHTML !== '')clearList();//清空列表
li = '';
// console.log(li);

for(let item of allFundList){
    if(item.fundname.match(val) || item.fundcode.match(val)){
        queryArr.push(item);
        // console.log(111);
    }
}
console.log(queryArr)
for(let item2 of queryArr){
    li += 
    '<div><li>' 
    + item2.fundname + '</li>' + '<li>' 
    + item2.fundcode + 
    '</li></div><br>';
}

console.log(li);
oList.innerHTML = li;
oList.innerHTML('li');
if(oList.innerHTML == rt.innerHTML){
  rt.style.display = 'none';
}else{
  rt.style.display = 'block';
}
}
function clearList(){
    oList.innerHTML = '';    
    queryArr = [];
}
console.log(li);
oList.innerHTML = li;
oList.innerHTML('li');
// if(oList.innerHTML === ''){
//     oNoData.style.display = 'block';
// }else{
//     oNoData.style.display = 'none';
// }
// }
// function clearList(){
//     oList.innerHTML = '';    
//     queryArr = [];
// }


